package com.ddstation.verifycode.property;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class VerifyCodeProperties {
	private final static String fileName = "/verify_code.properties";
	
	public static void initialize(String rootpath) throws IOException {
		Properties prop =  new  Properties();
		InputStream in = new FileInputStream(rootpath + fileName);
		prop.load(in);
		VERIFY_CODE_DIGIT = Integer.parseInt(prop.getProperty( "VERIFY_CODE_DIGIT" ).trim());
		VERIFY_CODE_EXPIRES_SHORTMESSAGE = Integer.parseInt(prop.getProperty( "VERIFY_CODE_EXPIRES_SHORTMESSAGE" ).trim());
		VERIFY_CODE_EXPIRES_EMAIL = Integer.parseInt(prop.getProperty( "VERIFY_CODE_EXPIRES_EMAIL" ).trim());
	}
	
	public static Integer VERIFY_CODE_DIGIT = null;
	public static Integer VERIFY_CODE_EXPIRES_SHORTMESSAGE = null;
	public static Integer VERIFY_CODE_EXPIRES_EMAIL = null;
}
